<template>
  <div class="home-container">
    <div class="home-content">
      <h1 class="app-title">AI智能体应用</h1>
      <p class="app-subtitle">选择您需要的AI服务</p>
      
      <div class="service-cards">
        <div class="service-card love-master" @click="navigateToLoveMaster">
          <div class="card-icon">💕</div>
          <h3 class="card-title">AI恋爱大师</h3>
          <p class="card-description">专业的恋爱咨询服务，帮您解决情感问题</p>
          <button class="card-button love-master-btn">开始咨询</button>
        </div>
        
        <div class="service-card agent" @click="navigateToAgent">
          <div class="card-icon">🤖</div>
          <h3 class="card-title">AI超级智能体</h3>
          <p class="card-description">全能AI助手，为您提供各种智能服务</p>
          <button class="card-button agent-btn">开始对话</button>
        </div>
      </div>
    </div>
    
    <!-- 底部栏 -->
    <AppFooter />
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';
import AppFooter from '../components/AppFooter.vue';

const router = useRouter();

const navigateToLoveMaster = () => {
  router.push('/love-master');
};

const navigateToAgent = () => {
  router.push('/agent');
};
</script>

<style scoped>
.home-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  padding: var(--spacing-5);
  animation: fadeIn 0.6s ease-out;
}

.home-content {
  text-align: center;
  max-width: 900px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: slideUp 0.8s ease-out;
  margin: 0 auto;
}

.app-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin-bottom: var(--spacing-4);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  line-height: var(--line-height-tight);
}

.app-subtitle {
  font-size: var(--font-size-xl);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--spacing-12);
  line-height: var(--line-height-normal);
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-8);
  margin-top: var(--spacing-8);
}

.service-card {
  background: var(--color-white);
  border-radius: var(--radius-3xl);
  padding: var(--spacing-8);
  box-shadow: var(--shadow-xl);
  transition: var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.service-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-2xl);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transition: var(--transition-base);
}

.love-master::before {
  background: linear-gradient(90deg, var(--color-love-master), var(--color-love-master-light));
}

.agent::before {
  background: linear-gradient(90deg, var(--color-agent), var(--color-agent-light));
}

.card-icon {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--spacing-4);
  display: block;
  animation: bounce 2s infinite;
}

.card-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-4);
  line-height: var(--line-height-tight);
}

.card-description {
  color: var(--color-text-regular);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-8);
  font-size: var(--font-size-base);
}

.card-button {
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: var(--spacing-3) var(--spacing-8);
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-base);
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.love-master-btn {
  background: var(--color-love-master);
}

.love-master-btn:hover {
  background: var(--color-love-master-dark);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.agent-btn {
  background: var(--color-agent);
}

.agent-btn:hover {
  background: var(--color-agent-dark);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* 响应式设计 */
/* 平板端 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .home-container {
    padding: var(--spacing-6);
  }
  
  .app-title {
    font-size: var(--font-size-3xl);
  }
  
  .app-subtitle {
    font-size: var(--font-size-lg);
  }
  
  .service-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-6);
  }
  
  .service-card {
    padding: var(--spacing-6);
  }
}

/* 手机端 (< 768px) */
@media (max-width: 767px) {
  .home-container {
    padding: var(--spacing-4);
    min-height: 100vh;
  }
  
  .app-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-3);
  }
  
  .app-subtitle {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-8);
  }
  
  .service-cards {
    grid-template-columns: 1fr;
    gap: var(--spacing-5);
    margin-top: var(--spacing-6);
  }
  
  .service-card {
    padding: var(--spacing-5);
  }
  
  .card-icon {
    font-size: var(--font-size-3xl);
  }
  
  .card-title {
    font-size: var(--font-size-xl);
  }
  
  .card-description {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-6);
  }
  
  .card-button {
    padding: var(--spacing-3) var(--spacing-6);
    font-size: var(--font-size-sm);
  }
}

/* 小屏手机端 (< 480px) */
@media (max-width: 479px) {
  .home-container {
    padding: var(--spacing-3);
  }
  
  .app-title {
    font-size: var(--font-size-xl);
  }
  
  .service-card {
    padding: var(--spacing-4);
  }
  
  .card-icon {
    font-size: var(--font-size-2xl);
  }
}

/* 大屏幕优化 (> 1280px) */
@media (min-width: 1280px) {
  .home-content {
    max-width: 1000px;
  }
  
  .service-cards {
    gap: var(--spacing-10);
  }
  
  .service-card {
    padding: var(--spacing-10);
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover {
    transform: none;
  }
  
  .service-card:active {
    transform: scale(0.98);
  }
  
  .card-button:hover {
    transform: none;
  }
  
  .card-button:active {
    transform: scale(0.95);
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

/* 减少动画效果（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  .home-container,
  .home-content,
  .card-icon {
    animation: none;
  }
  
  .service-card:hover {
    transform: translateY(-4px);
  }
}
</style>